﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using eShop.Business;
using eShop.Model;



public partial class admin_quick_print : SiteAdminBasePage
{
  

    protected void Page_Load(object sender, EventArgs e)
    {
        Order order = new Order();
        if (!Page.IsPostBack)
        {
            List<string> idList = new List<string>();
            if (Session["PrintOrderList"] != null)
            {
                //casting line below
                idList = (List<string>)Session["PrintOrderList"];
                for (int i = 0; i < idList.Count; i++)
                {
                    order = OrderManager.GetOrderById(Convert.ToInt32(idList[i]));
                    if (order != null)
                    {
                        if (hdnOrderId.Value.Length > 0)
                            hdnOrderId.Value = hdnOrderId.Value + ",";
                        hdnOrderId.Value = hdnOrderId.Value + order.OrderNumber;

                    }

                }
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "_showblockui", "OpenWindow();", true);
            }
            else
            {
                Response.Redirect(eShop.Business.CustomSiteMap.SalesCCSuccess);
            }
        }
    }
}